package com.aierkeji.b2c.dao.jpa;

import java.util.Optional;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import com.aierkeji.b2c.dao.BaseJPADao;
import com.aierkeji.b2c.dao.jpa.custom.AkjAlipayLifeSnapDaoCustom;
import com.aierkeji.b2c.entity.snapshot.AkjAlipayLifeSnap;

public interface AkjAlipayLifeSnapDao extends BaseJPADao<AkjAlipayLifeSnap,String> ,AkjAlipayLifeSnapDaoCustom{

	@Query("select t from AkjAlipayLifeSnap t join AkjOrderRecord a on t.id = a.lifeId where a.id = :recordId")
	public AkjAlipayLifeSnap findByRecordId(@Param("recordId") String recordId);
	
	public Optional<AkjAlipayLifeSnap> findFirstByLifeIdAndDeleteOrderByIdDesc(@Param("lifeId") String lifeId,@Param("delete") Boolean delete);
}
